<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tld/FCKeditor" prefix="FCK" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>添加自动播放新闻</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
.vb_wid {width:100%; margin: 0 auto; border-top:1px #FDB18D solid; background:#F5F5F5; color:#FE6500; text-indent:20px; line-height:25px; font-size:12px;}
.fb_search {width:90%; margin:0 auto; margin-top:20px; border:1px #FFCD7F solid;}
.fb_search h1 {background:#FFEFBB; margin:0px; padding:0px; line-height:28px; text-indent:10px; font-size:14px;}
.fb_ddd {width:90%; margin:0 auto; margin-top:10px; border-top:3px #FFCC00 solid; background:url(images/pen.gif) no-repeat 5px 3px; height:40px; text-indent:50px; line-height:40px; color:#464646; font-size:12px;}
.fb_nr {width:90%; margin:0 auto; margin-top:10px; line-height:40px; font-size:12px; color:#464646}
.fb_nr span {color:#CCC;}
.fb_nr select {color:464646; font-size:12px;}
.fb_nr Div {margin-left:10px;}
.fb_nr .table11 {border-top:1px #FFCC66 solid; background:#FFF2D7;}
.fb_nr .table22 {border-top:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
.fb_nr .table33 {border-top:1px #FFCC66 solid; border-bottom:1px #FFCC66 solid; background:#FFF2D7;}
.fb_nr .table44 {border-top:1px #E1E1E1 solid; border-bottom:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
.inputtttt {border:1px #DEA303 solid; height:20px; color:#464646; font-size:12px; background:url(images/bottom_bg.jpg) repeat-x left top;}
</style>
<script type="text/javascript">

     //校验form
     function  checkForm(){

    	 var id=document.getElementById('id').value;
    	 var title=document.getElementById('title').value;
    	 var link=document.getElementById('link').value;
    	 var type=document.getElementById('type').value;
    	 var formFile=document.getElementById('formFile').value;

    	//id必须设置
         if(id==''){
              alert('id必须设置!');
              return false;
         }
    	 
           //标题必须设置
           if(title==''){
                alert('标题必须设置!');
                return false;
           }

           //外部链接必须设置
           if(link==''){
               alert('外部链接必须设置!');
               return false;
           }

           //类型必须设置
           if(type=='' || type=='-1'){
               alert('类型必须设置!');
               return false;
           }

           //图片必须设置
           if(formFile==''){
               alert('图片必须输入!');
               return false;
           }

           return true;
     }  

</script>

  </head>
<body>
<logic:present name="add">
<bean:write name="add" filter="false"/>
</logic:present>
<div class="fb_ddd">添加自动播放新闻</div>
<div class="fb_nr">
    <html:form action="/admin/autoPlay.do?action=update" onsubmit="return checkForm();" enctype="multipart/form-data">
     <table width="100%" border="0">
     <tr>
      <input type="hidden" id="id" name="id" value="${autoPlay.id}"/>
      <td width="17%" align="center" class="table11">标题:</td>
      <td width="83%" class="table22">
      <div>
         <label>
           <input type="text" id="title"  name="title" class="cpxx_int" size="50" value="${autoPlay.title}"/><font color="red">*</font>
         </label>
      </div>
      </td>
	</tr>
	 <tr>
      <td align="center" class="table11">外部链接:</td>
      <td class="table22"><div>
      <label>
           <input type="text"  id="link" name="link" class="cpxx_int" size="50" value="${autoPlay.link}"/><font color="red">*</font>
         </label>
        
      </div></td>
       </tr>
        <tr>
      <td align="center" class="table11">类型:</td>
      <td class="table22"><div><label>
        <html:select  property="type"  value="${autoPlay.type}">
	    <html:option value="-1" >请选择</html:option>
	    <html:option value="index" >首页</html:option>
	    </html:select>
       </label></div></td>
       </tr>
       
       <tr>
      <td align="center" class="table11">状态:</td>
      <td class="table22"><div><label>
        <html:select  property="status"  value="${autoPlay.status}">
        <html:option value="0" >正常</html:option>
	    <html:option value="-1" >删除</html:option>
	    </html:select>
       </label></div></td>
       </tr>
       
        <tr>
	      <td align="center" class="table11">图片:</td>
	      <td class="table22"><div><label>
	       <input type="file" id="formFile" name="formFile" />
	       </label></div></td>
       </tr>
       
	   <tr>
         <td></td>
         <td><label>
           <input type="submit" name="Submit" value="更新" class="cpxx_int1" />
         </label>
         
         </td>
       </tr>
     </table>
         </html:form>
   <h1><img src="image/qqddc_shop1.gif" width="720" height="8" /></h1>
</div>
</body>
</html:html>
